package com.ss.android.article.common;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;

public class TabLinearLayout extends LinearLayout {
    public int mCurrentPosition;
    public float mPositionOffset;
    private Paint c;

    public TabLinearLayout(Context arg1) {
        super(arg1);
        this.a();
    }

    public TabLinearLayout(Context arg1, AttributeSet arg2) {
        super(arg1, arg2);
        this.a();
    }

    public TabLinearLayout(Context arg1, AttributeSet arg2, int arg3) {
        super(arg1, arg2, arg3);
        this.a();
    }

    private void a() {
        this.setWillNotDraw(false);
        this.c = new Paint(1);
        this.c.setStyle(Paint.Style.FILL);
        this.c.setColor(ContextCompat.getColor(this.getContext(), R.color.ssxinzi4));
    }

    protected void onDraw(Canvas arg7) {
        super.onDraw(arg7);
        int v0 = this.getHeight() - (((int) UIUtils.dp2px(this.getContext(), 2f)));
        View v3 = this.getChildAt(this.mCurrentPosition);
        int v4 = ((int)((((float)v3.getLeft())) + this.mPositionOffset * (((float)(this.getChildAt(1).getLeft() - this.getChildAt(0).getLeft())))));
        arg7.drawRect(((float)v4), ((float)v0), ((float)(v3.getWidth() + v4)), ((float)this.getHeight()), this.c);
    }
}

